/*
 * Copyright 2010-2011 Sanjay Dwivedi.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.isdinvestments.cam.domain.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the EVENT database table.
 * 
 */
@Entity
public class Event implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="EVENT_ID_GENERATOR", sequenceName="EVENT_ID_SEQ")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="EVENT_ID_GENERATOR")
	private long id;

	@Column(name="CREATED_BY")
	private String createdBy;

    @Temporal( TemporalType.DATE)
	@Column(name="CREATED_DATE")
	private Date createdDate;

    @Temporal( TemporalType.DATE)
	@Column(name="EVENT_DATE")
	private Date eventDate;

	@Column(name="UPDATED_BY")
	private String updatedBy;

    @Temporal( TemporalType.DATE)
	@Column(name="UPDATED_DATE")
	private Date updatedDate;

	//bi-directional many-to-one association to EventType
    @ManyToOne
	@JoinColumn(name="EVENT_TYPE")
	private EventType eventTypeBean;

	//bi-directional many-to-one association to Position
	@OneToMany(mappedBy="event")
	private Set<Position> positions;

	//bi-directional many-to-one association to PositionSnapshot
	@OneToMany(mappedBy="event")
	private Set<PositionSnapshot> positionSnapshots;

    public Event() {
    }

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getEventDate() {
		return this.eventDate;
	}

	public void setEventDate(Date eventDate) {
		this.eventDate = eventDate;
	}

	public String getUpdatedBy() {
		return this.updatedBy;
	}

	public void setUpdatedBy(String updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getUpdatedDate() {
		return this.updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}

	public EventType getEventTypeBean() {
		return this.eventTypeBean;
	}

	public void setEventTypeBean(EventType eventTypeBean) {
		this.eventTypeBean = eventTypeBean;
	}
	
	public Set<Position> getPositions() {
		return this.positions;
	}

	public void setPositions(Set<Position> positions) {
		this.positions = positions;
	}
	
	public Set<PositionSnapshot> getPositionSnapshots() {
		return this.positionSnapshots;
	}

	public void setPositionSnapshots(Set<PositionSnapshot> positionSnapshots) {
		this.positionSnapshots = positionSnapshots;
	}
	
}